package cqrtplm.mapper;


import com.alibaba.fastjson.JSONObject;
import com.hustcad.plm.pdm.type.model.vo.TypeTree;
import com.ty.basic.vo.AttributeVO;
import cqrtplm.dto.RTAttributeCardDTO;
import cqrtplm.entity.RTAttributeCardDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.BaseMapper;

import java.math.BigInteger;
import java.util.List;

@Mapper
public interface RTAttributeCardMapper extends BaseMapper<RTAttributeCardDO> {

    void updateAttrCard( RTAttributeCardDO rtAttributeCardDO);

    void batchDeleteAttrCardByOid(@Param("oids") List<BigInteger> oids);

    void insertAttrCard(RTAttributeCardDO rtAttributeCard);

    List<RTAttributeCardDTO> list(@Param("developmentOrder")String developmentOrder,@Param("productLine")String productLine,
                                  @Param("category")String category,@Param("attributeCard")String attributeCard, @Param("type")String type);

    List<RTAttributeCardDO> findPossibleMatches(String type,String category, String developmentOrder, String productLine);

    BigInteger queryAttrLinkClassify(String attributeCard);

    List<String> queryProjectLine(@Param("name")String name);

    List<String>  getExtendAttributeByRTAttributeCardDO(@Param("rtAttributeCardDO") RTAttributeCardDO rtAttributeCardDO,@Param("typeName") String typeName);

    RTAttributeCardDO selectDetailById(BigInteger oid);

    List<RTAttributeCardDO> designCodeFindMatchOne(@Param("type")String type, @Param("category") String category, @Param("developmentOrder")String developmentOrder);

    List<RTAttributeCardDO> designCodeFindMatchTwo(@Param("type") String type, @Param("category") String category, @Param("productSeries") String productSeries, @Param("productLine") String productLine);

    List<RTAttributeCardDO> designCodeFindMatchThree(@Param("type")String type, @Param("category") String category, @Param("productLine")String productLine);

    List<RTAttributeCardDO> designCodeFindMatchForth(@Param("type")String type, @Param("category")String category);

    BigInteger queryPartId(String patternCode);

    List<RTAttributeCardDO> queryAttrCardByCategory(@Param("category")String category, @Param("type") String type);

    String selectAttributeGroupNameById(@Param("oid") BigInteger oid);

    List<AttributeVO> queryAttrDefByDisName(@Param("keyName") List<String> keyName);

    List<TypeTree> queryTypeTreeByOid(BigInteger oid);

    String selectProductType(@Param("dev") BigInteger developmentOrder,@Param("productType") String productType);

    List<BigInteger> selectObjById(@Param("dev") String developmentOrder, @Param("type")String type,@Param("typeOid") BigInteger typeOid);

    Integer getDistinctByType(@Param("rtAttributeCard")RTAttributeCardDO rtAttributeCard);

    List<String> getDeleteById(@Param("oids") List<BigInteger> oids);

    List<BigInteger> queryClassifyById(@Param("oids")List<BigInteger> oids);

    List<String> selectProductSeriesByPartOidList(@Param("partOidList") List<BigInteger> partOidList);

    Integer selectOrderExit(String development_order,String product_line,String product_series,String category);

    String selectClassTypeNameById(@Param("id") String attributeCard);

    List<String> selectAllCode(String keyWork);

    String queryClassIdByPatternCode(@Param("patternCode")String patternCode);

    String selectAttrGroupNameById(@Param("oid") String oid);

    String selectEnumByAttrDefMapOid(@Param("attrDefOid") String attrDefOid);

    List<JSONObject> queryIbaAttrOIdByName(@Param("names") List<String> names);

    List<String> queryProductLine();

    List<String> queryProductSubcategory(@Param("productLine") String productLine);

    List<RTAttributeCardDO> findEBOMCardFirst(@Param("type")String type, @Param("developmentOrder")String developmentOrder);

    List<RTAttributeCardDO> findEBOMCardSecond(@Param("productSeries") String productSeries, @Param("productLine") String productLine, @Param("type") String type);

    List<RTAttributeCardDO> findEBOMCardThird(@Param("lineCode") String lineCode, @Param("type") String type);

    List<String> checkCurrentCardIfExistObj(String fix, String devCode, String productLine, String productSeries, String type);
}
